package test;

//统计大写子母个数

import java.util.Scanner;

public class topic10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            String s = sc.nextLine();
            int kk = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) >= 'A' && s.charAt(i) <= 'Z'){
                    kk ++;
                }
            }
            System.out.println(kk);
        }
    }
}
